From 013540cfc965b1693604c3f2e8dfb6afe2cc68d0 Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Tue, 29 Dec 2015 23:33:19 +0000 Subject: [PATCH] Revert "Sync up with Parsoid parserTests." Something is broken in the syncing worfklow. I deleted a test that cscott added in 1888bf560. Reverting this sync so we can figure out what is broken. This reverts commit b55a729f74a9af552c1c57586e89e9c6e53b55e4. Change-Id: Idd32daa95bb44fd073262a1c37ded236bf724e5d --- tests/parser/parserTests.txt | 539 ++++++++--------------------------- 1 file changed, 116 insertions(+), 423 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 7437a8cc7a..0ed8270e50 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -14,7 +14,6 @@ # Plus any combination of these: # # cat add category links -# (ignored by Parsoid, since it emits s) # ill add inter-language links # (ignored by Parsoid, since it emits s) # subpage enable subpages (disabled by default) @@ -1336,8 +1335,6 @@ array ( ) -!! html/parsoid -

 !! end
 
 !! test
@@ -3332,18 +3329,14 @@ parsoid=wt2html,wt2wt
   
 !! end
 
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize all categories to serialize on their own line.
-## This wikitext usage is going to be fairly uncommon in production and
-## selser will take care of preserving formatting in those scenarios.
 !! test
 7b. Indent-pre and category links
 !! options
-parsoid=wt2html
+parsoid=wt2html,wt2wt
 !! wikitext
  [[Category:foo]] a
  [[Category:foo]] {{echo|b}}
-!! html/parsoid
+!! html
 
 a
   b
!! end @@ -7126,17 +7119,6 @@ Piped link with multiple pipe characters in link text

|The|Main|Page|

!! end -!! test -Piped link with no link text -!! wikitext -[[Thomas Bek (bishop of St David's)|]] -!! html/php -

[[Thomas Bek (bishop of St David's)|]] -

-!! html/parsoid -

[[Thomas Bek (bishop of St David's)|]]

-!! end - !! test Broken link !! wikitext @@ -10878,14 +10860,8 @@ Un-closed !! html !! end -## We used to, but no longer wt2wt this test since the default serializer -## will normalize the include directives to serialize on their own line. -## Selser will take care of preserving formatting in scenarios where they -## intermingled with other wikitext. !! test Includes and comments at SOL -!! options -parsoid=wt2html,html2html !! wikitext == hu == @@ -11066,14 +11042,10 @@ parsoid=wt2html,wt2wt !!end -## We used to, but no longer wt2wt this test since the default serializer -## will normalize the include directives to serialize on their own line. -## Selser will take care of preserving formatting in scenarios where they -## intermingled with other wikitext. !!test 2. Table tag in SOL posn. should get reparsed correctly with valid TSR !!options -parsoid=wt2html +parsoid=wt2html,wt2wt !!wikitext a{| {{{b}}} |c @@ -14273,7 +14245,7 @@ cat pst !! wikitext [[Category:MediaWiki User's Guide|]] -!! html/php +!! html [[Category:MediaWiki User's Guide|MediaWiki User's Guide]] !! end @@ -14284,26 +14256,19 @@ cat pst !! wikitext [[Category:Foo (bar)|]] -!! html/php +!! html [[Category:Foo (bar)|Foo]] !! end -## We used to, but no longer wt2wt this test since the default serializer -## will normalize all categories to serialize on their own line. -## This wikitext usage is going to be fairly uncommon in production and -## selser will take care of preserving formatting in those scenarios. !! test Category with link tail !! options cat pst -parsoid=wt2html !! wikitext 123[[Category:Foo]]456 -!! html/php +!! html 123[[Category:Foo]]456 -!! html/parsoid -

123456

!! end !! test @@ -14313,7 +14278,7 @@ cat pst !! wikitext [[Category:{{echo|Foo}}]] -!! html/php +!! html [[Category:{{echo|Foo}}]] !! end @@ -14324,7 +14289,7 @@ cat pst !! wikitext [[Category:Foo|{{echo|Bar}}]] -!! html/php +!! html [[Category:Foo|{{echo|Bar}}]] !! end @@ -14335,18 +14300,12 @@ cat pst !! wikitext [[Category:{{echo|Foo}}|{{echo|Bar}}]] -!! html/php +!! html [[Category:{{echo|Foo}}|{{echo|Bar}}]] !! end -## We used to, but no longer wt2wt this test since the default serializer -## will normalize all categories to serialize on their own line. -## This wikitext usage is going to be fairly uncommon in production and -## selser will take care of preserving formatting in those scenarios. !! test Category / paragraph interactions -!! options -parsoid=wt2html !! wikitext Foo [[Category:Baz]] Bar @@ -14373,7 +14332,7 @@ Bar [[Category:Baz]] {{echo|[[Category:Baz]]}} [[Category:Baz]] -!! html/php +!! html

Foo Bar

Foo Bar @@ -14383,32 +14342,20 @@ Bar

Foo Bar

-!! html/parsoid -

Foo Bar

-

Foo Bar

-

Foo Bar

-

Foo Bar

-

Foo Bar

- !! end -## We used to, but no longer wt2wt this test since the default serializer -## will normalize all categories to serialize on their own line. -## This wikitext usage is going to be fairly uncommon in production and -## selser will take care of preserving formatting in those scenarios. -## ## The whitespace on the empty line is part of the test. Please do not delete !! test 1. Categories and newlines: All preceding newlines should be suppressed (courtesy bug 87) !! options -parsoid=wt2html +parsoid=wt2html,wt2wt !! wikitext This [[Category:Foo]] and this should be part of same paragraph (not an indent-pre) {{echo|[[Category:Foo]] and so should this!}} -!! html/php +!! html

This and this should be part of same paragraph (not an indent-pre) and so should this!

!! html/parsoid @@ -14506,14 +14453,8 @@ parsoid=wt2html !! end -## We used to, but no longer wt2wt this test since the default serializer -## will normalize all categories to serialize on their own line. -## This wikitext usage is going to be fairly uncommon in production and -## selser will take care of preserving formatting in those scenarios. !! test 6. Categories and newlines: migrateTrailingCategories dom pass should not migrate categories not preceded by newlines -!! options -parsoid=wt2html !! wikitext * a [[Category:Foo]] !! html/parsoid @@ -14564,20 +14505,13 @@ parsoid

!! end -# We used to, but no longer wt2wt this test since the default serializer -# will normalize all categories to serialize on their own line. -# This wikitext usage is going to be fairly uncommon in production and -# selser will take care of preventing whitespace insertion if this -# occurs in an article. -# -# html2html disabled for the same reason (whitespace insertion between -# x and y). -# -# html2wt disabled because it localizes the "Category" namespace. +# html2wt localizes the "Category" namespace. +# XXX the element needs an empty data-parsoid attribute, or +# else the html2html test fails because spaces are inserted. !! test Link prefix/suffixes aren't applied to category links !! options -parsoid=wt2html +parsoid=wt2html,wt2wt,html2html language=is !! wikitext x[[Category:Foo]]y @@ -16218,15 +16152,10 @@ array ( ) -!! html/parsoid -

 !! end
 
-## Don't expect parsoid to rt this form.
 !! test
 Parser hook: empty input using terminated empty elements
-!! options
-parsoid=wt2html,html2html
 !! wikitext
 
 !! html/php
@@ -16236,8 +16165,6 @@ array (
 )
 
 
-!! html/parsoid
-

 !! end
 
 !! test
@@ -16251,8 +16178,6 @@ array (
 )
 
 
-!! html/parsoid
-

 !! end
 
 !! test
@@ -16266,15 +16191,11 @@ array (
 )
 
 
-!! html/parsoid
-

 !! end
 
-## Don't expect parsoid to rt this form.
+
 !! test
 Parser hook: case insensitive
-!! options
-parsoid=wt2html,html2html
 !! wikitext
 input
 !! html/php
@@ -16284,15 +16205,11 @@ array (
 )
 
 
-!! html/parsoid
-

 !! end
 
-## Don't expect parsoid to rt this form.
+
 !! test
 Parser hook: case insensitive, redux
-!! options
-parsoid=wt2html,html2html
 !! wikitext
 input
 !! html/php
@@ -16302,8 +16219,6 @@ array (
 )
 
 
-!! html/parsoid
-

 !! end
 
 !! test
@@ -16319,35 +16234,11 @@ array (
 )
 </tag>
 
-!! html/parsoid
-
</tag>
 !! end
 
 !! test
 Parser hook: basic arguments
 !! wikitext
-
-!! html/php
-
-''
-array (
-  'width' => '200',
-  'height' => '100',
-  'depth' => '50',
-  'square' => '',
-)
-
- -!! html/parsoid -

-!! end
-
-## Don't expect parsoid to rt this form.
-!! test
-Parser hook: basic arguments, variations
-!! options
-parsoid=wt2html,html2html
-!! wikitext
 
 !! html/php
 
@@ -16360,14 +16251,12 @@ array (
 )
 
-!! html/parsoid -

 !! end
 
 !! test
 Parser hook: argument containing a forward slash (bug 5344)
 !! wikitext
-
+
 !! html/php
 
 ''
@@ -16376,15 +16265,10 @@ array (
 )
 
-!! html/parsoid -

 !! end
 
-## Don't expect parsoid to rt this form.
 !! test
 Parser hook: empty input using terminated empty elements (bug 2374)
-!! options
-parsoid=wt2html,html2html
 !! wikitext
 text
 !! html/php
@@ -16395,8 +16279,6 @@ array (
 )
 text
 
-!! html/parsoid
-
text
 !! end
 
 # 
should be output literally since there is no matching tag that begins it @@ -16429,28 +16311,21 @@ array ( Parser hook: static parser hook not inside a comment !! wikitext hello, world - - + !! html/php -


-hello, world +

hello, world

-!! html/parsoid -

-

hello, world

!! end + !! test Parser hook: static parser hook inside a comment !! wikitext - + !! html/php


-!! html/parsoid - -

!! end # Nested template calls; this case was broken by Parser.php rev 1.506, @@ -19336,25 +19211,17 @@ Category:分類 blah !! endarticle -## We used to, but no longer wt2wt this test since the default serializer -## will normalize all categories to serialize on their own line. -## This wikitext usage is going to be fairly uncommon in production and -## selser will take care of preserving formatting in those scenarios. !! test Don't convert blue categorylinks to another variant (bug 33210) !! options -cat -language=zh -parsoid=wt2html +language=zh cat !! wikitext [[A]][[Category:分类]] -!! html/php +!! html 分类 -!! html/parsoid -

A

- !! end + !! test Stripping -{}- tags (language variants) !! options @@ -19889,7 +19756,7 @@ Tildes in comments pst !! wikitext -!! html/php +!! html !! end @@ -20211,7 +20078,7 @@ Edit comment with link comment !! wikitext I like the [[Main Page]] a lot -!! html/php +!! html I like the Main Page a lot !!end @@ -20221,7 +20088,7 @@ Edit comment with link and link text comment !! wikitext I like the [[Main Page|best pages]] a lot -!! html/php +!! html I like the best pages a lot !!end @@ -20231,7 +20098,7 @@ Edit comment with link and link text with suffix comment !! wikitext I like the [[Main Page|best page]]s a lot -!! html/php +!! html I like the best pages a lot !!end @@ -20241,7 +20108,7 @@ Edit comment with section link (non-local, eg in history list) comment title=[[Main Page]] !! wikitext /* External links */ removed bogus entries -!! html/php +!! html →‎External links: removed bogus entries !!end @@ -20251,7 +20118,7 @@ Edit comment with section link and text before it (non-local, eg in history list comment title=[[Main Page]] !! wikitext pre-comment text /* External links */ removed bogus entries -!! html/php +!! html pre-comment text →‎External links: removed bogus entries !!end @@ -20261,7 +20128,7 @@ Edit comment with section link (local, eg in diff view) comment local title=[[Main Page]] !! wikitext /* External links */ removed bogus entries -!! html/php +!! html →‎External links: removed bogus entries !!end @@ -20273,7 +20140,7 @@ subpage title=[[Subpage test]] !! wikitext Poked at a [[/subpage]] here... -!! html/php +!! html Poked at a /subpage here... !!end @@ -20285,7 +20152,7 @@ subpage title=[[Subpage test]] !! wikitext Poked at a [[/subpage|neat little page]] here... -!! html/php +!! html Poked at a neat little page here... !!end @@ -20296,7 +20163,7 @@ comment title=[[Subpage test]] !! wikitext Poked at a [[/subpage]] here... -!! html/php +!! html Poked at a /subpage here... !!end @@ -20308,7 +20175,7 @@ local title=[[Main Page]] !! wikitext [[#section]] -!! html/php +!! html #section !! end @@ -20319,28 +20186,24 @@ comment title=[[Main Page]] !! wikitext [[#section]] -!! html/php +!! html #section !! end !! test Anchor starting with underscore -!! options -title=[[Foo]] !! wikitext [[#_ref|One]] -!! html/php +!! html

One

-!! html/parsoid -

One

!! end !! test Id starting with underscore !! wikitext
-!! html/* +!! html
!! end @@ -20352,7 +20215,7 @@ comment title=[[Main Page]] !! wikitext /* __hello__world__ */ -!! html/php +!! html →‎__hello__world__ !! end @@ -20671,14 +20534,20 @@ HTML5 data attributes !! wikitext Baz

Quuz

-!! html/php +!! html

Baz

Quuz

-!! html/parsoid -

Baz

-

Quuz

+!! end + +!! test +Strip reserved data attributes +!! wikitext +
d
+!! html +
d
+ !! end !! test @@ -21517,12 +21386,14 @@ parsoid=wt2html,wt2wt !!test Ref: 1. ref-location should be replaced with an index span +!!options +parsoid !! wikitext A foo B foo C -!! html/parsoid +!! html

A [1] B [2] C [3]

@@ -21535,11 +21406,13 @@ C foo
B -!! html/parsoid +!! html

A [1] B [1]

    @@ -21549,12 +21422,14 @@ B foo B C -!! html/parsoid +!! html

    A [1] B [1] C [1]

    @@ -21566,10 +21441,12 @@ C foo
    -!! html/parsoid +!! html

    A [1]

    1. ↑ foo
    2. @@ -21578,13 +21455,15 @@ A foo !!test Ref: 5. body should accept generic wikitext +!!options +parsoid !! wikitext A This is a '''[[bolded link]]''' and this is a {{echo|transclusion}} -!! html/parsoid +!! html

      A [1]

        @@ -21595,6 +21474,8 @@ A !!test Ref: 6. indent-pres should not be output in ref-body +!!options +parsoid !! wikitext A foo @@ -21603,7 +21484,7 @@ A -!! html/parsoid +!! html

        A [1]

          @@ -21616,6 +21497,8 @@ A !!test Ref: 7. No p-wrapping in ref-body +!!options +parsoid !! wikitext A foo @@ -21631,7 +21514,7 @@ booz -!! html/parsoid +!! html

          A [1]

            @@ -21651,23 +21534,27 @@ booz !!test Ref: 8. transclusion wikitext has lower precedence +!!options +parsoid !! wikitext A foo {{echo| B C}} -!! html/parsoid +!! html

            A [1] B C}}

              -
            1. ↑ foo {{echo|
            2. +
            3. ↑ foo {{echo|
            !!end !!test Ref: 9. unclosed comments should not leak out of ref-body +!!options +parsoid !! wikitext A foo @@ -21676,11 +21563,13 @@ A foo [[Category:A3]] how goes it == +== [[Category:A3]] how goes it == -== it goes well [[Category:A4]] == +== it goes well [[Category:A4]] == -==howdy [[Category:A5]]== +==howdy [[Category:A5]] == == __TOC__ ok == !! end @@ -25745,7 +25620,7 @@ parsoid={ "modes": ["html2wt"], "suppressErrors": true } # shown to sneak through on occasion. See T101768. # The original wikitext here is: [http://test.com [[one]] two three] !! test -Strip span tags added to mark misnested links +Strip span tags added to mark as misnested !! options parsoid=html2wt !! html/parsoid @@ -25754,112 +25629,10 @@ parsoid=html2wt [http://test.com][[one]] two three !! end -!! test -Use data-parsoid.firstWikitextNode to compute newline constraints for template content -!! options -parsoid=html2wt -!! html/parsoid -a - -
            d -
            -!! wikitext -{{echo|a}} -{|{{echo|c -{{!}}d -}} -|} -!! end - -## This test verifies the presence and computation of this attribute indirectly -## by making an edit and ensuring that the serialization is correct (which it would be -## only if firstWikitextNode is properly set). -!! test -data-parsoid.firstWikitextNode should be computed properly in the presence of fostered content -!! options -parsoid= { - "modes": ["wt2wt"], - "changes": [ - [ "div#x", "remove" ], - [ "div", "before", "
            new
            " ] - ] -} -!! wikitext -
            foo
            -{| -{{echo|
            boo
            -{{!}}b}} -|c -|} -!! wikitext/edited - -
            new
            -{| -{{echo|
            boo
            -{{!}}b}} -|c -|} -!! end - # -------------------------------------------- # Tests spec'ing wikitext serialization norms | # -------------------------------------------- -!! test -1. Categories should always be serialized on their own line -!! options -parsoid=html2wt -!! html/parsoid -foobar -!! wikitext -foo -[[Category:Foo]] -bar -!! end - -!! test -2. Categories that are part of templates should not introduce a line break -!! wikitext -foo {{echo|bar [[Category:baz]]}} bar -!! html/parsoid -

            foo bar bar

            -!! end - -# Careful while editing these next 2 tests. There are \u200f characters -# before and after the tags in the HTML and following some -# of the categories in wikitext -# Do not remove these characters in edits. -# -# As part of the serialization, these bidi characters will get stripped. -!! test -RTL (\u200f) and LTR (\u200e) markers around category tags should be stripped -!! options -parsoid={ - "modes": ["html2wt"], - "scrubWikitext": true -} -!! html/parsoid -

            ‏‏ -‏‏

            -!! wikitext -[[קטגוריה:טקסים]] -[[קטגוריה: שיטות משפט]] -!! end - -!! test -RTL (\u200f) and LTR (\u200e) markers should not be stripped if followed by a text node -!! options -parsoid={ - "modes": ["html2wt"], - "scrubWikitext": true -} -!! html/parsoid -

            ‏‏y

            -!! wikitext -[[קטגוריה:טקסים]] -‏y -!! end - !! test Lists: Add space after bullets !! options @@ -25947,35 +25720,6 @@ parsoid={ !! wikitext/edited !! end -!! test -Headings: Replace
            with a single whitespace char (when scrubWikitext = true) -!! options -parsoid={ - "modes": ["html2wt"], - "scrubWikitext": true -} -!! html/parsoid -

            foo
            bar

            -

            foo
            bar
            baz

            -!! wikitext -== foo bar == - -== foo bar baz == -!! end - -!! test -Headings: Replace
            with a single whitespace char (when scrubWikitext = false) -!! options -parsoid={ - "modes": ["html2wt"], - "scrubWikitext": false -} -!! html/parsoid -

            foo
            bar

            -!! wikitext -== foo
            bar == -!! end - !! test 1. WT Quote Tags: suppress newly created empty style tags !! options @@ -26481,61 +26225,10 @@ parsoid=html2wt <nowiki>''foo''</nowiki> !! end -# This is meant to be an interim fix while we go about figuring out -# how to not introduce these trailing s in the first place. -!! test -T115717: Strip trailing s (without affecting valid uses) -!! options -parsoid=html2wt -!! html/parsoid -

            x -y

            -

            -

            -!! wikitext -x -y - -{{echo| -1 = }} - -{{echo| -1 = -}} -!! end - # --------------------------------------------------- # End of tests spec'ing wikitext serialization norms | # --------------------------------------------------- -# T104032 -!! test -Bare inline nodes not wrapped inside p-tags should be treated as p-wrapped -!! options -parsoid=html2wt -!! html/parsoid -a

            b

            -c

            d

            - - - -
            a

            b

            c

            d

            -!! wikitext -a - -b - -'''c''' - -d -{| -|a -b -|'''c''' -d -|} -!! end - # ----------------------------------------------------------------- # End of section for Parsoid-only html2wt tests for serialization # of new content -- 2.20.1